home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
001a
/
add_tm_d.zip
/
REPLAC20.DOC
< prev
next >
Wrap
Text File
|
1988-01-14
|
6KB
|
123 lines
REPLACE ver 2.0 Copyright (C) 1986,1987,1988, RainTree Computer Systems
All Rights Reserved.
-- REPLACE --
Program Description:
This program searches an input file for a defined string and replaces it with
a new string as it copies the input file to the output. It operates in
either of two modes: filter or utility. As a filter it gets its input from
the redirected Standard Input file (STDIN), and sends its output to the
Standard Output file (STDOUT). It requires file redirection symbols for this
mode of operation. Operating as a filter only one file can be input with its
output redirected to any directory and filename. It is completely compatible
with DOS redirection philosophy including piping. To count the occurance of
a string in an input file, redirect the output to the system file NUL.
In the utility mode an input file may be specified which includes DOS
wildcards in the filename. In this form of operation multiple files may be
processed in a single execution of the program. In addition to specifying an
input file the utility operation requires that an output directory be
specified for the destination location of the output file(s). The name of
output files in utility mode is always the same as its corresponding input
file name. To count the occurance of a string in the specified input files,
simply do not specify the output destination directory.
Finally, please note that this program manages the strings as binary data.
This means it may be used to modify non-text files such as program files,
recognizing the considerable understanding required in this regard.
Statment Syntax:
Filter: REPLACE "Old_String" "New_String" /c /s <infile >outfile
Utility: REPLACE "Old_String" "New_String" /c /s infilemask outdir
The first two parameters are the "Old_String" and "New_String". They are the
only required parameters. The "New_String" must even be included as a nul
parameter ("") when the old string is being deleted. Both strings are
enclosed with double quotes. They must contain only ASCII characters, and
the \ddd decimal values or the \sss synonyms to represent any non-ASCII
(binary) values within the string.
\ddd - where ddd is any 3-digit decimal number from 000 through 255
representing a binary byte configuration or control character.
\sss - where sss is a word synonym for a corresponding byte value. Synonyms
must always be written in UPPER CASE.
Synonym - Definition Synonym - Definition
\NULL - binary zero (ASCIIZ) \ESC - escape
\BELL - bell \SPC - space (blank)
\BS - backspace \BLK - blank (space)
\HT - horizontal tab \" - double quote
\LF - line feed \DQ - double quote
\VT - vertical tab \' - single quote
\FF - forms feed \SQ - single qote
\CR - carriage return \\ - single back slash
\EOF - end of file
Switches: must be separated by a blank.
/c - Case sensitive: upper and lower case characters compare unequal.
Default: NOT case sensitive- upper and lower case compare equal.
/s - Silent mode: do not display anything on the screen; clean screen.
Files: Drive:\Paths\Filename (Paths must already exist.)
Filter operation; redirection symbols < > MUST preceed each file specification.
infile The input file where the Old_String will be found.
outfile The output file to be created with the New_String.
Utility Operation; redirection symbols are NOT valid here.
infilemask Input file name supporting wildcards for multiple files.
outdir Drive:\Directory where the output files will be written.
Filter Examples:
-Add linefeeds to a file received by modem with only carriage returns.
REPLACE "\CR" "\CR\LF" <myfile >fixedfil
REPLACE "\CR" "\CR\LF" /s <myfile >fixedfil
-Delete a string: specify the Old_String and no New_String.
REPLACE "Old_String" "" <infile >outfile
REPLACE "Old_String" "" /c /s <infile >outfile
-Count occurrences of a pattern by specifying a >NUL output file.
REPLACE "Old_String" "" <infile >NUL
REPLACE "Old_String" "" /c <infile >NUL
Utility Examples:
-Add linefeeds to files received by modem with only carriage returns.
REPLACE "\CR" "\CR\LF" *.txt \tmp
REPLACE "\CR" "\CR\LF" /s *.txt \tmp
-Delete a string in multiple files: specify the Old_String and no New_String.
REPLACE "Old_String" "" \bat\*.bat \newbat
REPLACE "Old_String" "" /c /s \bat\*.bat \newbat
-Count occurrences of a pattern by not specifying an output directory.
REPLACE "Old_String" "" \doc\*.*
REPLACE "Old_String" "" /c \doc\*.*
DOS Return Codes:
0 -replacements occurred 3 -parameters incorrectly specified
1 -no replacements occurred 4 -input file not found
2 -processed help request 5 -output directory not found
License:
This program is protected by copyright. It may be used and distributed
without charge. It may NOT be combined with software or hardware, for
sale or for rent where the charge is over 7 dollars.
THIS PROGRAM WARRANTS NOTHING.
ITS USE IS COMPLETELY AT THE USERS OWN RISK.
Shareware:
Do you use this program ? If so why not make a $15. contribution to
support this method of software development and distribution. All
for-profit and government organizations are required to make a $15.
payment per copy of this program for continued use after evaluation.
Payments may be made to: RainTree Computer Systems (REPLACE)
P.O.Box 2401
San Anselmo, CA 94960 USA
------